package cn.tedu.spring.file;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Repository;

/**
 * 加载外部属性文件，即:resources/application.properties
 */
@PropertySource(value = "classpath:application.properties")
@Repository
public class Database {
    @Value("${databaseUrl}")
    private String dbUrl;
    @Value("${uname}")
    private String uname;
    @Value("${password}")
    private String pwd;

    @Override
    public String toString() {
        return "Database{" +
                "dbUrl='" + dbUrl + '\'' +
                ", uname='" + uname + '\'' +
                ", pwd='" + pwd + '\'' +
                '}';
    }
}
